<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <style>

    </style>
    <script src="vue.js"></script>
</head>
<body>
<div id="app">
    <button @click="greeting=!greeting">显隐控制</button>
    <template v-if="greeting">
        <h1>标题</h1>
        <p>内容1</p>
        <p>{{msg}}</p>
    </template>
</div>

</body>
<script>
    new Vue({
        el: '#app',
        data: {
            msg:'内容2',
            greeting: false
        }
    })
</script>
</html>



















